
//- This Source Code Form is subject to the terms of the Mozilla Public
//- License, v. 2.0. If a copy of the MPL was not distributed with this
//- file, You can obtain one at http://mozilla.org/MPL/2.0/.
//-
//- Copyright (c) 2021-present Kaleidos Ventures SL

tg-lightbox-close
form
    h2.title(translate="COMMON.NEW_BULK")

    fieldset(ng-if="project.us_statuses")
        .label {{ 'LIGHTBOX.CREATE_EDIT.SELECT_STATUS' | translate }}
        .bulk-status-selector-wrapper
            button.bulk-status-selector(
                type="button"
                ng-click="toggleStatus()"
                ng-style="{'background-color': currentStatus.color}"
            )
                span {{ currentStatus.name }}
                tg-svg(svg-icon="icon-arrow-down")
            .bulk-status-option-wrapper(
                ng-show="displayStatusSelector"
            )
                button.bulk-status-option(
                    type="button"
                    ng-repeat="status in project.us_statuses"
                    ng-click="setStatus(status)"
                    ng-class="{'selected': status.id == currentStatus.id}"
                ) {{status.name}}

    fieldset.creation-position
        .label {{ 'LIGHTBOX.CREATE_EDIT.LOCATION' | translate }}

        .creation-position-fields
            label(class="custom-radio")
                input(
                    id="top-backlog"
                    type='radio'
                    ng-model="new.us_position"
                    value="bottom"
                    checked
                )
                span.radio-control
                span.radio-label {{ 'LIGHTBOX.CREATE_EDIT.CREATE_BOTTOM' | translate }}

            label(class="custom-radio")
                input(
                    id="bottom-backlog"
                    type='radio'
                    ng-model="new.us_position"
                    value="top"
                )
                span.radio-control
                span.radio-label {{ 'LIGHTBOX.CREATE_EDIT.CREATE_TOP' | translate }}

    fieldset.swimlane-select(ng-if="project.is_kanban_activated && swimlanesList.size")
        .label {{ 'LIGHTBOX.CREATE_EDIT.SELECT_SWIMLANE' | translate }}
        tg-swimlane-selector(
            ng-model="new.swimlane"
            swimlanes="swimlanesList"
            default-swimlane-id="project.default_swimlane"
            user-story="new"
            has-unclassified-stories="noSwimlaneUserStories"
            ng-if="new"
        )
    fieldset
        textarea(
            cols="200"
            wrap="off"
            ng-model="new.bulk"
            data-required="true"
            data-linewidth="200"
            ng-attr-placeholder="{{'COMMON.ONE_ITEM_LINE' | translate}}"
        )
    .lb-action-wrapper
        button.btn-small.js-submit-button(
            variant="primary"
            type="submit",
            title="{{'COMMON.SAVE' | translate}}",
            translate="COMMON.SAVE"
        )
